package vip.sweet.biz.modular.expert.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import vip.sweet.biz.modular.expert.params.BizExpertsAddParams;
import vip.sweet.biz.modular.expert.service.BizExpertsService;
import vip.sweet.common.enums.ResponseEnum;
import vip.sweet.common.response.CommonResponse;

/**
 * @author ASUS
 * @Date 2025/10/5 11:06
 * @Descripition
 */
@RestController
@RequestMapping("/biz/experts")
@Tag(name = "专家控制器")
public class BizExpertsController {
    @Resource
    private BizExpertsService bizExpertsService;
    @PostMapping("/add")
    @Operation(summary = "添加专家接口")
    public CommonResponse add(@RequestBody @Validated BizExpertsAddParams bizExpertsAddParams) {
        return bizExpertsService.add(bizExpertsAddParams)? CommonResponse.success("添加成功") : CommonResponse.error(ResponseEnum.ERROR);
    }
    @GetMapping("/list")
    @Operation(summary = "获取专家列表接口")
    public CommonResponse list() {
        return CommonResponse.success(bizExpertsService.list());
    }
}
